/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package concurrent.sincalculator;

/**
 *
 * @author harker777
 */
public strictfp class Slave extends ValueReturningRunnableImpl<Double> {
	private Integer from;
	private Integer to;

	public Slave(Integer from, Integer to){
		this.from = from;
		this.to = to;
	}

	@Override
	public void run() {
		double result = 0.0;
		for (int x = from; x <= to; x++){
			result += Math.cos(x);
		}
		setValue(result);
	}
}
